import time
from selenium import webdriver

# 1.准备配置项信息
mobileEmulation = {"deviceName":"iPhone XR"}
# 2.创建一个options的对象
options = webdriver.ChromeOptions()
# 3.添加配置信息
options.add_experimental_option('mobileEmulation',mobileEmulation)
# 4.打开浏览器,用浏览器来加载配置项信息
driver = webdriver.Chrome(options=options)
# 5.访问百度
driver.get('https://www.baidu.com')
time.sleep(5)
# 6. 关闭浏览器
driver.quit()